Replication Files for:

Clark, Christopher J., and Steven Rogers. "Public Perceptions of Minority Inclusion and Feelings of 
Political Efficacy: A Replication, Validation, and Extension" at The American Political Science Review.

Compiled by Steven Rogers, 10/25/2024 (smrogers@slu.edu).

Analyses use the following software:
    R version 4.3.2 (2023-10-31 ucrt)
    
    Attached R packages: 
    qdapRegex_0.7.8  Hmisc_5.1-3      gridExtra_2.3    ggplot2_3.5.1    dataverse_0.3.14 haven_2.5.4  

    Attached base packages:
    stats     graphics  grDevices utils     datasets  methods   base

STATA/MP 16.1 for Windows (64-bit x86-64)
    STATA Packages: package estout from http://fmwww.bc.edu/repec/bocode/e
      'ESTOUT': module to make regression tables
        To install estout in STATA, use the command: ssc install estout, replace

Running under: Windows 10 Enterprise; OS Build 19045.2846
Estimate Run Time for All Analyses: Between 25 and 30 minutes.

##############################################################################
# The following sections identify folders and describe files within folders. #
##############################################################################

\readme.txt
	# Readme file for "Public Perceptions of Minority Inclusion and Feelings of 
	Political Efficacy: A Replication, Validation, and Extension"

\Codebook for Clark-Rogers.pdf
	# Codebook for data used in "Public Perceptions of Minority Inclusion and Feelings of 
	Political Efficacy: A Replication, Validation, and Extension"

\Data 

	Data\Congress-Minority-Legislators-Race-Gender.csv
		# This file includes whether a respondent's Representative in the US House or US Senate was female and/or Black

	Data\DistancetoStateCapital.csv
		# This file includes a respondent's zip code's distance from the state capital

	Data\StateLevelVariables.csv
		# This file includes state-level variables (e.g., which party controlled a respondent's state house or state 
		# senate or their state's ideology) used in analyses, as described in the main text or online appendix

\Scripts

  ########################################################################################################################
  # To run any of the below scripts, the user will need to set the appropriate working directory.  			 #
  #	For example, in R scripts, change the second line following code: 			          		 #
  #                                                                                                                      #
  #	# Set this Working Directory to the Folder with the Replication Files                                            #   
  #	# ("C:/Steven/GDrive/Research Files/Clark-Rogers/Descriptive Representation/APSR Final Submissions/Replication"  #
  ########################################################################################################################

\Scripts

	\Scripts\Clark-Rogers Format Data.R
		# This script creates the main datasets used in the analyses. It first creates subfolders to hold files created by
		other scripts in the replication files.  It then downloads the 2018 CES, 2018 SLU CES Module,  and Stauffer (2021) 
		replication files from the Harvard Dataverse.  It then creates a dataset with measures using the 2018 CES and SLU 
		Module that are comparable to measures in the Stauffer replication files.  Finally, it creates common variable names
		between the datasets to facilitate the creation of tables in subsequent scripts. Datasets will be exported to
		\Data\Formatted Data

			# The above script will create the following subfolders
				\Figures
				# This folder holds main text figures created by Figure scripts
				
				\Figures\Appendix
				# This folder holds appendix figures created by Figure scripts

				\Figures\Estimates
				# This folder hold estimates of quantities of interest for figures

				\Figures\Estimates\Racial Resentment
				# This folder hold estimates of quantities of interest for figures
				# specific to racial resentment and sexism figures in Appendix

				\Data\Formatted Data
				# This folder holds formatted data for analyses

	\Scripts\Run all R-Based Table and Figure Scripts.R
		# This script will run all R-Scripts that create tables and figures. Please note that STATA scripts need to be 
		# run before this script will work.  See instructions at the end of this readme file.

	\Scripts\Figures\Generate Estimates for Figures.do
		# This .do file will estimate quantities of interest (e.g., coefficients and predicted probabilities) to be plotted
		in Figures.  These quantities of interest will be stored in .CSV files in \Scripts\Figures\Estimates or subfolders of
		\Scripts\Figures\Estimates

	# The following scripts will create the figures that are indicated in their file name 
	# (e.g.,\Scripts\Figures\Figure 1.R generates Figure 1 . All generated Figures will be stored in \Figures or \Figures\Appendix

		\Scripts\Figures\Figure 1.R
		\Scripts\Figures\Figure 2.R
		\Scripts\Figures\Figure 3.R
		\Scripts\Figures\Figure 4.R
		\Scripts\Figures\Figure A-1.R
		\Scripts\Figures\Figure A-2.R
		\Scripts\Figures\Figure A-3.R
		\Scripts\Figures\Figure A-4.R
		\Scripts\Figures\Figure A-5.R
		\Scripts\Figures\Figure A-6.R
		\Scripts\Figures\Figure A-7.R
		\Scripts\Figures\Figure A-8.R
		\Scripts\Figures\Figure A-9.R
		\Scripts\Figures\Figure A-10.R
		\Scripts\Figures\Figure A-11.R

	\Scripts\Tables\Table-A-6.R
		# This script creates summary statistics Table A-6.  This table is created in .CSV format and stored in \Tables
	
	\Scripts\Tables\Table-A-7.R
		# This script creates summary statistics Table A-7.  This table is created in .CSV format and stored in \Tables
	
	\Scripts\Tables\Clark-Rogers - Appendix Tables.do
		# This .do file will generate all Appendix tables except Tables A-5 (manually created), A-6, and A-7. These tables 
		are created in .rtf format and stored in \Tables

############################################
# Data not included in replication archive #
############################################

Descriptions and analyses in “Public Perceptions of Minority Inclusion and Feelings of Political Efficacy: A Replication, Validation, 
and Extension” use the 2018 CES, a 2018 CES survey module, replication files from (Stauffer 2021). For descriptions of CES measures, we refer 
readers to the documentation available at the Harvard Dataverse:

- Brian Schaffner; Stephen Ansolabehere; Sam Luks, 2019, "CCES Common Content, 2018”, https://doi.org/10.7910/DVN/ZSBZ7K, Harvard Dataverse, 
     V6, UNF:6:hFVU8vQ/SLTMUXPgmUw3JQ== [fileUNF]
- Rogers, Steven, 2020, "CCES 2018, Team Module of St. Louis University”, https://doi.org/10.7910/DVN/JYNAQR, Harvard Dataverse, 
     V2, UNF:6:8S1ozmpsEj7I5+Bc1ih08w== [fileUNF]  
- Stauffer, Katelyn, 2021, "Replication Data for: Public Perceptions of Women’s Inclusion and Feelings of Political Efficacy", 
     https://doi.org/10.7910/DVN/QYZGEI, Harvard Dataverse, V1, UNF:6:odztGoO+orWmyUyYxvaOug== [fileUNF]

###################################
# Instructions for Replication	  #
###################################

To replicate all analyses, produce all tables, and produce all figures, 
individuals should run the following .R and .do files in the following order:
	1) \Scripts\Clark-Rogers Format Data.R
	2) \Scripts\Figures\Generate Estimates for Figures.do
	3) \Scripts\Tables\Clark-Rogers - Appendix Tables.do
	4) \Scripts\Run all R-Based Table and Figure Scripts.R
		# Note, depending on computer setup, running #4 script above at times
		# produces blank Figures A-4 and A-5 when using the R source command.
		# If this occurs, users should independently run \Scripts\Figures\Figure A-4.R and
		# and \Scripts\Figures\Figure A-5.R .

